package com.ds.infrastructure.hyperspace.console.entity.enums;

/**
 * @author: yaozhendong
 * @create: 2019-10-23 11:44
 **/

public interface TbDeployActiveTaskEnum {
    /**
     * TEMP_TYPE类型:1(ONE);2(TWO)
     */
    enum EXECUTE_STATE {
        INIT(1, "初始化（未执行状态）"),
        CREATE_NODE(2, "创建节点"),
        SUCCESS(3, "成功"),
        FAIL(4, "失败");

        public final Integer code;
        private final String desc;

        EXECUTE_STATE(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static EXECUTE_STATE toEnum(int value) {
            for (EXECUTE_STATE item : EXECUTE_STATE.values()) {
                if (item.code == value) {
                    return item;
                }
            }
            return null;
        }
    }

}
